package org.dev4j.jdbc.custom.interfaces;

import java.util.List;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.RowMapper;

/**
 * JdbcCustomTemplate
 * 
 * @author fuster
 * 
 */
public interface JdbcCustomTemplate extends JdbcOperations {

	/**
	 * Query for jdbcTemplate with args
	 * 
	 * @param clazz
	 * @param args
	 * @param sql
	 * @return
	 * @throws DataAccessException
	 */
	public List query( Class clazz, Object[] args, String sql ) throws DataAccessException;

	/**
	 * Query for jdbcTemplate without args
	 * 
	 * @param clazz
	 * @param args
	 * @param sql
	 * @return
	 * @throws DataAccessException
	 */
	public List query( Class clazz, String sql ) throws DataAccessException;

	/**
	 * Query for object with args
	 * 
	 * @param requiredType
	 * @param args
	 * @param sql
	 * @return
	 * @throws DataAccessException
	 */
	public Object unique( Class requiredType, Object[] args, String sql ) throws DataAccessException;

	/**
	 * Query for object without args
	 * 
	 * @param requiredType
	 * @param sql
	 * @return
	 * @throws DataAccessException
	 */
	public Object unique( Class requiredType, String sql ) throws DataAccessException;

	/**
	 * 
	 * @param clazz
	 * @return
	 */
	public RowMapper extract( Class clazz );

}
